package com.apartment.own.service.impl;

import java.util.List;
import com.apartment.common.utils.DateUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.apartment.own.mapper.OwnOrdCashPledgeMapper;
import com.apartment.own.domain.OwnOrdCashPledge;
import com.apartment.own.service.IOwnOrdCashPledgeService;

/**
 * 押金Service业务层处理
 * 
 * @author @Dog_E
 * @date 2020-08-28
 */
@Service
public class OwnOrdCashPledgeServiceImpl extends ServiceImpl<OwnOrdCashPledgeMapper,OwnOrdCashPledge> implements IOwnOrdCashPledgeService
{
    @Autowired
    private OwnOrdCashPledgeMapper ownOrdCashPledgeMapper;

    /**
     * 查询押金
     * 
     * @param id 押金ID
     * @return 押金
     */
    @Override
    public OwnOrdCashPledge selectOwnOrdCashPledgeById(Long id)
    {
        return ownOrdCashPledgeMapper.selectOwnOrdCashPledgeById(id);
    }

    /**
     * 查询押金列表
     * 
     * @param ownOrdCashPledge 押金
     * @return 押金
     */
    @Override
    public List<OwnOrdCashPledge> selectOwnOrdCashPledgeList(OwnOrdCashPledge ownOrdCashPledge)
    {
        return ownOrdCashPledgeMapper.selectOwnOrdCashPledgeList(ownOrdCashPledge);
    }

    /**
     * 新增押金
     * 
     * @param ownOrdCashPledge 押金
     * @return 结果
     */
    @Override
    public int insertOwnOrdCashPledge(OwnOrdCashPledge ownOrdCashPledge)
    {
        ownOrdCashPledge.setCreateTime(DateUtils.getNowDate());
        return ownOrdCashPledgeMapper.insertOwnOrdCashPledge(ownOrdCashPledge);
    }

    /**
     * 修改押金
     * 
     * @param ownOrdCashPledge 押金
     * @return 结果
     */
    @Override
    public int updateOwnOrdCashPledge(OwnOrdCashPledge ownOrdCashPledge)
    {
        ownOrdCashPledge.setUpdateTime(DateUtils.getNowDate());
        return ownOrdCashPledgeMapper.updateOwnOrdCashPledge(ownOrdCashPledge);
    }

    /**
     * 批量删除押金
     * 
     * @param ids 需要删除的押金ID
     * @return 结果
     */
    @Override
    public int deleteOwnOrdCashPledgeByIds(Long[] ids)
    {
        return ownOrdCashPledgeMapper.deleteOwnOrdCashPledgeByIds(ids);
    }

    /**
     * 删除押金信息
     * 
     * @param id 押金ID
     * @return 结果
     */
    @Override
    public int deleteOwnOrdCashPledgeById(Long id)
    {
        return ownOrdCashPledgeMapper.deleteOwnOrdCashPledgeById(id);
    }
}
